package com.ruoyi.common.core.enums;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * 赛区枚举
 */
public enum BMAreaEnum {

    // 第一类赛区 (code = 1)
    GUANGZHOU(1, "广州赛区"),
    HUIZHOU(1, "惠州赛区"),
    DONGGUAN(1, "东莞赛区"),
    FOSHAN(1, "佛山赛区"),

    // 第二类赛区 (code = 2)
    ZHONGKAI_HIGHTECH(2, "仲恺高新区赛区"),
    HUIDONG(2, "惠东赛区"),
    DAYA_BAY(2, "大亚湾赛区"),
    HUIYANG(2, "惠阳赛区"),
    HUICHENG(2, "惠城赛区"),
    BOLUO(2, "博罗赛区"),
    LONGMEN(2, "龙门赛区");
    ;

    private final Integer code;
    private final String info;

    BMAreaEnum(Integer code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public Integer getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }
    public static List<BMAreaEnum> getValue(Integer code) {
        List<BMAreaEnum> list = new ArrayList<>();
        if (code == null) {
            code = 1;
        }
        for (BMAreaEnum typeEnum : BMAreaEnum.values()) {
            if (Objects.equals(typeEnum.getCode(), code)) {
                list.add(typeEnum);
            }
        }
        return list;
    }
}
